load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("//pkg/testutils:buildutil/buildutil.bzl", "disallowed_imports_test")

go_library(
    name = "seqexpr",
    srcs = ["sequence.go"],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog/seqexpr",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/funcdesc",
        "//pkg/sql/parser",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/sem/builtins/builtinconstants",
        "//pkg/sql/sem/tree",
        "//pkg/sql/types",
        "@com_github_cockroachdb_errors//:errors",
    ],
)

go_test(
    name = "seqexpr_test",
    srcs = ["sequence_test.go"],
    deps = [
        ":seqexpr",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/parser",
        "//pkg/sql/sem/builtins",
        "//pkg/sql/sem/tree",
        "//pkg/sql/types",
        "@com_github_stretchr_testify//require",
    ],
)

disallowed_imports_test(
    "seqexpr",
    [
        "//pkg/sql/sem/builtins",
    ],
)
